#ifndef _BUOLA_NET_CXMLRPCSTRUCT_H_
#define _BUOLA_NET_CXMLRPCSTRUCT_H_

#include <buola/xml.h>

namespace buola { namespace io {

class CXMLRPCArray;
class CXMLRPCCall;
    
class CXMLRPCStruct
{
public:
    CXMLRPCStruct();
    CXMLRPCStruct(CXMLRPCCall &pCall);
    CXMLRPCStruct(xml::CNode pStruct);
    
    void AddItem(const std::string &pName,const std::string &pValue);
    void AddItem(const std::string &pName,double pValue);
    
    void GetItem(const std::string &pName,int &pValue);
    void GetItem(const std::string &pName,bool &pValue);
    void GetItem(const std::string &pName,double &pValue);
    void GetItem(const std::string &pName,std::string &pValue);
    void GetItem(const std::string &pName,CXMLRPCStruct &pValue);
    void GetItem(const std::string &pName,CXMLRPCArray &pValue);
    
    xml::CNode XML() const   {   return mStruct; }

private:
    xml::CNode GetItem(const std::string &pName);
    
    xml::CNode mStruct;
};

/*namespace io*/ } /*namespace buola*/ }

#endif
